/**
 * @file
 * @author Daniel White
 * @version 0.1
 * @brief CAN HAS VECTORZ?
 * @section Description
 * 
 * (I'll get round to this)
 */

#ifndef VECTOR_HEADER
#define VECTOR_HEADER

/* Typedefs */
typedef struct
{
	float X;
	float Y;
	float Z;
}Vector;

/** An alias to Vector_Destroy */
#define Vector_Free(V) (Vector_Destroy(V))

/**
 * Creates a vector and returns a pointer to it.
 *
 * @return On success, a pointer to the vector, otherwise a NULL pointer.
 */ 
inline Vector *Vector_Create();

/**
 * Destroys a vector, freeing the memory used.
 *
 * @param Vector The vector to destroy.
 */
inline void Vector_Destroy(Vector *Vector);

/**
 * Calculates the length, or magntiude of a vector.
 *
 * @param Vector The vector to get the length of.
 * @return The length.
 */ 
inline float Vector_Length(Vector *Vector);

/**
 * Scales a vector by the given float (also known as scalar multiplication).
 *
 * @param Vector The vector to scale.
 * @param Scale The factor to scale by. 
 */ 
inline void Vector_Scale(Vector *Vector, float Scale);

/**
 * Normalizes a vector (makes its length equal to 1).
 *
 * @param Vector The vector to normalize. 
 */ 
inline void Vector_Normalize(Vector *Vector);

/**
 * Caclulates the dot product of two vectors.
 *
 * @param Vector0 The first vector.
 * @param Vector1 The second vector.
 * @return The dot product of the vectors.
 */ 
inline float Vector_DotProduct(Vector *Vector0, Vector *Vector1);

/**
 * Caclulates the cross product of two vectors.
 *
 * @param Result The vector where the result is stored. 
 * @param Vector0 The first vector.
 * @param Vector1 The second vector.
 */ 
inline void Vector_CrossProduct(Vector *Result, Vector *Vector0, Vector *Vector1);

/**
 * Caclulates the sum of two vectors.
 *
 * @param Result The vector where the result is stored. 
 * @param Vector0 The first vector.
 * @param Vector1 The second vector.
 */
inline void Vector_Add(Vector *Result, Vector *Vector0, Vector *Vector1);

/**
 * Caclulates the difference between two vectors.
 *
 * @param Result The vector where the result is stored. 
 * @param Vector0 The first vector.
 * @param Vector1 The second vector.
 */
inline void Vector_Subtract(Vector *Result, Vector *Vector0, Vector *Vector1);

#endif
